package com.material.vtool.mapper;

import com.material.vtool.entity.BTeamInfoEntity;
import com.material.vtool.entity.BTeamRelationEntity;
import com.material.vtool.entity.combinedEntity.CombinedTeamMemberEntity;
import com.material.vtool.entity.combinedEntity.UserTeamEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface TeamRelationMapper {
    Integer insertTeamRelation(BTeamRelationEntity bTeamRelationEntity);

    Integer updateUserFlag(@Param("userId") Integer userId, @Param("teamId") Integer teamId);

    Integer updateTeamMember(BTeamRelationEntity bTeamRelationEntity);

    BTeamRelationEntity getTeamMember(@Param("userId") Integer userId, @Param("teamId") Integer teamId);

    List<CombinedTeamMemberEntity> getTeamMemberListByKey(@Param("teamId") Integer teamId, @Param("key") String key);

    Integer getTeamMemberByKeyCount(@Param("teamId") Integer teamId, @Param("key") String key);

    List<CombinedTeamMemberEntity> getTeamMemberList(Integer teamId);

    Integer getTeamMemberCount(Integer teamId);

    List<UserTeamEntity> getUserTeamList(Integer userId);

    Integer increaseShareCount(@Param("teamId") Integer teamId, @Param("userId") Integer userId);

    BTeamInfoEntity getUserActiveTeamInfo(Integer userId);

    Integer getMemberLatestTeam(@Param("userId") Integer userId, @Param("teamId") Integer teamId);

    Integer updateMemberLatestTeamActive(Integer id);
}
